﻿@{ Layout = "../../Views/Shared/_LayoutPhone.cshtml";}
@**@
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
        <title>Document</title>
        <link href="~/GoTRI/vendor/bootstrap-4.1.3/css/bootstrap.min.css" rel="stylesheet" />
        <!-- community-index CSS -->

        <link rel="stylesheet" href="~/GoTRI/css/community-index.css">
        <!-- jQuery first, then Popper.js, then Bootstrap JS -->
        <script src="~/GoTRI/js/jquery-3.2.1.min.js"></script>
        <script src="~/GoTRI/js/popper.min.js"></script>
        <script src="~/GoTRI/vendor/bootstrap-4.1.3/js/bootstrap.min.js"></script>
    </head>
<body>
    <header id="head">
        <div>
            <img src="~/GoTRI/img/top-bg.png" />
        </div>
        <div class="title">
            <span>小区管理</span>
        </div>
    </header>
    <div class="main" id="xiaoqu" style="padding-top:30px">
        <!-- 主体列表 -->
        <ul id="xiaoqubangding">
        </ul>
        <div id="gengduo" class="btn" onclick="huibao()">
            <span>加载更多</span>
        </div>
        <div id="meiyou" align="center" hidden="hidden">
            <span style="color:darkgray;font-size:12px">没有更多加载了</span>
        </div>
        <label hidden="hidden" id="dianjicishu">0</label>
    </div>
    <div style="margin-bottom: 50px;padding-bottom:1px"></div>
    <script>
        $(document).ready(function () {
            $("#fangyuan1").attr("hidden", "");
            $("#fangyuan2").removeAttr("hidden", "");
            $("#fangyuan3").attr("hidden", "");
            $("#fangyuan4").removeAttr("hidden", "");

            $(function () {
                var isPageHide = false;
                window.addEventListener('pageshow', function () {
                    if (isPageHide) {
                        window.location.href = "../PhoneFangYuan/FangYuanList";
                    }
                });
                window.addEventListener('pagehide', function () {
                    isPageHide = true;
                });
            })
        })
        $(".yi").attr("hidden", "");
    </script>
</body>
<script>
    $(document).ready(function () {
        huibao();
    });

    function huibao() {

        $.ajax({
            type: 'post',
            url: '../PhoneFangYuan/Getfangyuan',
            async: false,
            data: { cishu: $("#dianjicishu").text() },
            dataType: 'text',
            success: function (date) {
                $("#xiaoqubangding").html(date);
                $("#dianjicishu").text(Number($("#dianjicishu").text()) + 1);
            },
        })
    }

    function tiaozhuan(id) {
        location.href = "../PhoneFangYuan/FangYuanXiangXi?id=" + id + "";
    }
</script>
